<?php 
	define('_EXEC',1);
	require_once("include/common.php");
	require_once("router.php");
	require_once("modules/controller.php");
	$c = Request::getController();
	if(empty($c)){
		$c = "default";
	}
	if(array_key_exists($c, $_ROUTER)){
		$file = false;
		if($_ROUTER[$c]==true){
			$file = "modules/".$c.".php";
		}else if(!empty($_ROUTER[$c])){
			$file = $_ROUTER[$c];
		}
		if($file && file_exists($file)){
			include_once $file;
			$task = Request::getTask();
			$controller = ucfirst($c)."Controller";
			$controller = new $controller();
			$controller->execute($task);
		}else{
			die("No controller");
		}
	}else{
		die("No controller");
	}